<template>
    <el-input
        v-if="editMode == 'edit'"
        :value="propValue"
        @input="handleInput"
        ref="v-text"
    ></el-input>
  <div v-else class="text disabled">
    <div v-for="(text, index) in propValue.split('\n')" :key="index">{{ text }}</div>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  props: {
    propValue: {
      type: String,
    },
    element: {
      type: Object,
    },
  },
  computed: mapState([
    'editMode',
  ]),
  methods: {
    handleInput(e) {
      this.$emit('input', this.element, e.target.value)
    },
  },
}
</script>
